Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow canvas local config #1496

Merged
merged 2 commits into from
Oct 24, 2024
Merged

Conversation

pauldambra
Copy link
Member

A user wants to be able to dynamically configure canvas recording... so, allow local config

Copy link

vercel bot commented Oct 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Oct 24, 2024 10:49am

@pauldambra pauldambra requested a review from a team October 24, 2024 10:15
@pauldambra
Copy link
Member Author

will tag @daibhin too in case of missing context :)

@pauldambra pauldambra added the bump minor Bump minor version when this PR gets merged label Oct 24, 2024
Copy link

github-actions bot commented Oct 24, 2024

Size Change: +3.21 kB (+0.11%)

Total Size: 2.89 MB

Filename Size Change
dist/array.full.es5.js 248 kB +323 B (+0.13%)
dist/array.full.js 335 kB +321 B (+0.1%)
dist/array.full.no-external.js 334 kB +321 B (+0.1%)
dist/array.js 156 kB +321 B (+0.21%)
dist/array.no-external.js 155 kB +321 B (+0.21%)
dist/main.js 157 kB +321 B (+0.21%)
dist/module.full.js 335 kB +321 B (+0.1%)
dist/module.full.no-external.js 334 kB +321 B (+0.1%)
dist/module.js 156 kB +321 B (+0.21%)
dist/module.no-external.js 155 kB +321 B (+0.21%)
ℹ️ View Unchanged
Filename Size
dist/all-external-dependencies.js 182 kB
dist/exception-autocapture.js 8.75 kB
dist/external-scripts-loader.js 2.19 kB
dist/recorder-v2.js 102 kB
dist/recorder.js 103 kB
dist/surveys-preview.js 56.7 kB
dist/surveys.js 62.1 kB
dist/tracing-headers.js 1.33 kB
dist/web-vitals.js 10.3 kB

compressed-size-action

Comment on lines +311 to +312
const fps = canvasRecording_client_side?.canvasFps ?? canvasRecording_server_side?.fps ?? 0
const quality = canvasRecording_client_side?.canvasQuality ?? canvasRecording_server_side?.quality ?? 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be careful about letting users arbitrarily set these two values. We could end up with very large recordings if they set the values too high, particularly the FPS. At the very least I would limit them to sensible ranges and emit a warning log

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah... fair.

have a feeling for reasonable range?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fps... between 0 and 12?
quality between 0 and 1?

Copy link
Contributor

@daibhin daibhin Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was very conservative rolling it out initially 😂

# hard coded during beta while we decide on sensible values
"canvasFps": 3 if record_canvas else None,
"canvasQuality": "0.4" if record_canvas else None,

They sound reasonable. Unlikely many people will change the defaults. We can always dial it back in future SDK versions if it causes issues

Copy link
Contributor

@daibhin daibhin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👌

@pauldambra pauldambra merged commit d2a12dd into main Oct 24, 2024
13 checks passed
@pauldambra pauldambra deleted the fix/allow-canvas-local-config branch October 24, 2024 11:01
@pauldambra pauldambra mentioned this pull request Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump minor Bump minor version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants